Lamport's bakery algorithm